import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          isCustomElement: tag => [
            'labelArea',
          ].includes(tag)
        }
      }
    })
  ],
  css: {
    preprocessorOptions: {
      sass: {
        additionalData: `@import "./src/style.sass"`
      }
    }
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  // devServer: {
  //   proxy: {
  //     '/download': {
  //       target: 'http://101.5.80.48:8080/convert/v3/json2xml',
  //       // target: 'http://172.20.45.139/tools/cleaner/x86_64/cleanProject_2024090401.tar.gz',
  //       ws: false,
  //       changeOrigin: true,
  //     }
  //   }
  // }
})